//
//  HXDSaveData.m
//  qingDaoCircleOfLife
//
//  Created by huxuedong on 15/11/21.
//  Copyright © 2015年 huxuedong. All rights reserved.
//

#import "HXDFunction.h"
#import "MD5.h"

@implementation HXDFunction

+ (void)saveValue:(BOOL)value forKey:(NSString *)key {
    [[NSUserDefaults standardUserDefaults] setBool:value forKey:key];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

+ (NSString *)getTime {
    return [NSString stringWithFormat:@"%f",[[NSDate date] timeIntervalSince1970]];
}

+ (NSString *)MD5Striing:(NSArray *)array {
    NSMutableString *stringM = [[NSMutableString alloc] init];
    [array enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        NSString *string = (NSString *)obj;
        [stringM appendString:string];
    }];
    return [MD5 MD5Encrypt:stringM];
}

@end
